//
//  StoreTableViewCell.m
//  Beauty
//
//  Created by Snow on 16/9/20.
//  Copyright © 2016年 Snow. All rights reserved.
//

#import "StoreTableViewCell.h"
#import "GXMacro.h"
@implementation StoreTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _image = [[UIImageView alloc]init];
        [self.contentView addSubview:_image];
        _labelOfName = [[UILabel alloc]init];
        [self.contentView addSubview:_labelOfName];
        _labelOfContent = [[UILabel alloc]init];
        [self.contentView addSubview:_labelOfContent];
        _button = [UIButton buttonWithType:UIButtonTypeSystem];
        [self.contentView addSubview:_button];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    [_image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.contentView.mas_left).mas_equalTo(10);
        make.top.mas_equalTo(self.contentView.mas_top).mas_equalTo(10);
        make.bottom.mas_equalTo(self.contentView.mas_bottom).mas_equalTo(-10);
        make.width.mas_equalTo(40);
    }];
    [_labelOfName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_image.mas_right).mas_equalTo(10);
        make.top.mas_equalTo(_image.mas_top);
        make.width.mas_equalTo(200);
        make.height.mas_equalTo(_image.mas_height).multipliedBy(0.4);
    }];
    [_labelOfContent mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_labelOfName.mas_bottom).mas_equalTo(10);
        make.left.mas_equalTo(_image.mas_right).mas_equalTo(10);
        make.height.mas_equalTo(_labelOfName.mas_height);
        make.width.mas_equalTo(_labelOfName.mas_width);
    }];
    [_button mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.contentView.mas_right).mas_equalTo(-10);
        make.top.mas_equalTo(self.contentView.mas_top).mas_equalTo(10);
        make.bottom.mas_equalTo(self.contentView.mas_bottom).mas_equalTo(-10);
        make.width.mas_equalTo(80);
    }];
    [_button setTitle:@"取消关注" forState:UIControlStateNormal];
    _button.layer.masksToBounds = YES;
    _button.layer.cornerRadius = 5;
    _button.layer.borderWidth = 1;
    _button.layer.borderColor = [[UIColor colorWithRed:0.157 green:0.169 blue:0.212 alpha:1.000] CGColor];
}

@end
